#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,a[100001],ans,cnt[100001];
int main(){
    //ios::sync_with_stdio(false);
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++)cin>>a[i];
    sort(a+1,a+n+1);
    int L=0;
    for(int i=1;i<=n;i++){
        cnt[a[i]]++;
        while(1){
            if(!cnt[L]){
                if(L+1<a[i])L++;
                else break;
            }
            else{
                cnt[L]--;
                ans--;
                break;
            }
        }
    }
    cout<<ans;
    return 0;
}
